<?php
$this->breadcrumbs=array(
	'Members'=>array('index'), 'Inactive'
);

$this->menu=array(
	array('label' => 'Aktive Mitglieder', 'url' => array('index')),
	array('label'=>'Liste exportieren', 'url'=>array('export/excelOld')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('member-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1>Ehemalige Mitglieder</h1>

<p>
Du kannst optional ein Vergleichspoerator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b>
or <b>=</b>) am  Anfang jedes Suchfeldes eingeben.
</p>

<?php echo CHtml::link('Erweiterte Suche','#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
</div><!-- search-form -->

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'member-grid',
	'dataProvider'=>$model->search(true),
	'filter'=>$model,
	'selectableRows' => 1,
	'selectionChanged'=>'function(id){ location.href = "'.$this->createUrl('view').'/id/"+$.fn.yiiGridView.getSelection(id);}',
	'columns'=>array(

		array(
			'name' => 'Vorname',
			'htmlOptions' => array('width' => '100')
		),
		array(
			'name' => 'Name',
			'htmlOptions' => array('width' => '100'),
		), 
		array(
			'name' => 'Strasse',
			'htmlOptions' => array('width' => '150')
		),
		array(
			'name' => 'Hausnummer',
			'value' => '$data->Hausnummer > 0 ? $data->Hausnummer : ""',
			'htmlOptions' => array('width' => '20')
		),
		array(
			'name' => 'PLZ',
			'htmlOptions' => array('width' => '20')
		),
		array(
			'name' => 'Ortschaft',
			'htmlOptions' => array('width' => '100')
		),
		array(
			'name' => 'austritt_search',
			'value' => 'date(\'d.m.Y\', strtotime($data->membership->Austritt))',
			'htmlOptions' => array('width' => 100)
		),
	),
)); ?>
